<%--
  Created by IntelliJ IDEA.
  User: Tiler
  Date: 2020/11/4
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %> <%--不要忽略EL表达式--%>
<html>
<head>
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<h1 class="text-center pt-3 pb-3">新增图书</h1>
<div class="container">
    <hr>
    <form action="add_book" method="post">
        <div class="form-group row">
            <h4 class="offset-md-3 col-md-2 text-right">图书名称：</h4>
            <div class="col-md-4">
                <input type="text" class="form-control" name="bookName" placeholder="">
            </div>
        </div>
        <div class="form-group row">
            <h4 class="offset-md-3 col-md-2 text-right">图书图片：</h4>
            <div class="col-md-4">
                <input type="text" class="form-control" name="image" placeholder="">
            </div>
        </div>
        <div class="form-group row">
            <h4 class="offset-md-3 col-md-2 text-right">出&nbsp;&nbsp;版&nbsp;&nbsp;社：</h4>
            <div class="col-md-4">
                <select class="form-control" name="publisher">
                    <c:forEach items="${publishers}" var="p">
                        <option value="${p.publisherId}">${p.publisherName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>

        <div class="form-group row">
            <h4 class="offset-md-3 col-md-2 text-right">图书分类：</h4>
            <div class="col-md-4">
                <c:forEach items="${categories}" var="c" varStatus="s">
                    <div class="form-check form-check-inline">
                        <label class="form-check-label">
                            <input type="checkbox" class="form-check-input" name="category" value="${c.categoryId}">${c.categoryName}
                        </label>
                    </div>
                </c:forEach>
            </div>
        </div>
        <div class="offset-md-5 col-md-4 text-left">
            <button type="submit" class="btn btn-primary">新增图书</button>
            <button type="button" class="btn btn-outline-primary">关闭窗口</button>
        </div>
    </form>
</div>
</body>
</html>
